/* GUI CONVERTED from recwoiq.p (converter v1.75) Wed Aug 30 09:12:41 2000 */
/* recwoiq.p - REPETITIVE                                                     */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* web convert recwoiq.p (converter v1.00) Fri Oct 10 13:57:58 1997 */
/* web tag in recwoiq.p (converter v1.00) Mon Oct 06 14:18:37 1997 */
/*F0PN*/ /*K0T6*/ /*                                                    */
/*V8:ConvertMode=Report                                              */
/* REVISION: 7.3      LAST MODIFIED: 10/31/94   BY: WUG   *GN77*              */
/* REVISION: 8.6      LAST MODIFIED: 10/11/97   BY: bvm   *K0T6*              */


/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb                  */
/* REVISION: 9.1      LAST MODIFIED: 08/28/00 BY: *N0PK* Dave Caveney         */

/* CUM WORKORDER INQUIRY                                                      */

/*K0T6*/ /* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K0T6*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE recwoiq_p_1 "Status"
/* MaxLen: Comment: */

&SCOPED-DEFINE recwoiq_p_2 "W/O #"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable nbr like wo_nbr label {&recwoiq_p_2}.
define variable lot like wo_lot.
define variable due like wo_due_date.
define variable so_job like wo_so_job.
define variable part like pt_part.
define variable site like rps_site.
define variable prline like rps_line.
/*K0T6*
 * def var wostatus as char label "Status".
 * def var active_wolot as char.
 *K0T6*/
/*K0T6*/ define variable wostatus as character label {&recwoiq_p_1}.
/*K0T6*/ define variable active_wolot as character.

/*K0T6* *moved up*
 * /* DISPLAY TITLE */
 * {mfdtitle.i "b+ "} **K0T6**/

part = global_part.
site = global_site.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
part     colon 13
   lot      colon 45
   site     colon 13
   prline   colon 45
with frame a side-labels no-underline width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K0T6*/ {wbrp01.i}

repeat:

/*K0T6*/ if c-application-mode <> 'web' then
      update part lot  site prline with frame a editing:

      if frame-field = "part" then do:

     /* FIND NEXT/PREVIOUS RECORD */
     {mfnp05.i wo_mstr wo_type_part "wo_type = ""C""" wo_part part}
     if recno <> ? then do:
        part = wo_part.
        display part with frame a.
        recno = ?.
     end.
      end.
      else if frame-field = "site" then do:
     /* FIND NEXT/PREVIOUS RECORD */
     {mfnp.i si_mstr site si_site site si_site si_site}
     if recno <> ? then do:
        display si_site @ site with frame a.
     end.
      end.
      else if frame-field = "prline" then do:
     /* FIND/NEXT PREVIOUS RECORD */
     {mfnp.i ln_mstr site ln_site prline ln_line ln_line}
     if recno <> ? then do:
        display ln_site @ site ln_line @ prline with frame a.
     end.
      end.
      else do:
     status input.
     readkey.
     apply lastkey.
      end.
   end.

/*K0T6*/ {wbrp06.i &command = update &fields = "  part lot site prline" &frm = "a"}

/*K0T6*/ if (c-application-mode <> 'web') or
/*K0T6*/ (c-application-mode = 'web' and
/*K0T6*/ (c-web-request begins 'data')) then do:

   hide frame b.
   hide frame d.
   hide frame f.
   hide frame g.
   hide frame h.

/*K0T6*/ end.

   /* SELECT PRINTER */
   {mfselprt.i "terminal" 80}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.


   /* FIND AND DISPLAY */
   if part <> "" then
   for each wo_mstr where wo_type = "C"
   and (wo_part = part)
   and (wo_lot = lot or lot = "" )
   and (wo_site = site or site = "")
   and (wo_line = prline or prline = "")
   and wo_nbr = ""
   use-index wo_type_part
   no-lock with frame b:
      /* SET EXTERNAL LABELS */
      setFrameLabels(frame b:handle).
      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/

      {recwoiq.i}
   end.

   else
   if lot <> "" then
   for each wo_mstr where wo_type = "C"
   and (wo_lot = lot)
   and (wo_site = site or site = "")
   and (wo_line = prline or prline = "")
   and wo_nbr = ""
   use-index wo_type_nbr
   no-lock with frame d:
      /* SET EXTERNAL LABELS */
      setFrameLabels(frame d:handle).
      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/

      {recwoiq.i}
   end.

   else
   if site <> "" then
   for each wo_mstr where wo_type = "C"
   and wo_site = site
   and (wo_line = prline or prline = "")
   and wo_nbr = ""
   use-index wo_type_part
   no-lock
   with frame g:
      /* SET EXTERNAL LABELS */
      setFrameLabels(frame g:handle).
      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/

      {recwoiq.i}
   end.

   else
   if prline <> "" then
   for each wo_mstr no-lock
   where wo_type = "C" and wo_line = prline
   and wo_nbr = ""
   use-index wo_type_part
   with frame h.
      /* SET EXTERNAL LABELS */
/*N0PK*/ setFrameLabels(frame h:handle).
/*N0PK*/ 
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/

      {recwoiq.i}
   end.

   else
   for each wo_mstr where wo_type = "C"
   and wo_nbr = ""
   use-index wo_type_nbr
   no-lock with frame f:
      /* SET EXTERNAL LABELS */
      setFrameLabels(frame f:handle).
      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/

      {recwoiq.i}
   end.

   {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   {mfmsg.i 8 1}
end.

global_part = part.
global_site = site.

/*K0T6*/ {wbrp04.i &frame-spec = a}
